package com.star.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.star.domain.Shop;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Star
 * @since 2021-04-21
 */
public interface ShopMapper extends BaseMapper<Shop> {

    /**
     * 修改 区域信息
     * @param areaId
     * @return
     */
    int shopAreaUpdate( @Param("areaId") Integer areaId,@Param("shopId") Integer shopId);

    /**
     * 修改 店铺类型
     */
    int shopTypeUpdate(@Param("shopTypeId")Integer shopTypeId,@Param("shopId") Integer shopId);

    /**
     * 修改登录id
     * @param userLoginId
     * @param shopId
     * @return
     */
    int logIdUpdate(@Param("logId")Integer userLoginId,@Param("shopId") Integer shopId);

    /**
     * 查询所有店铺
     * @param page
     * @param wrapper
     * @return
     */
    IPage<Map<String, Object>> shopFindAll(Page<Map<String, Object>> page,@Param(Constants.WRAPPER) QueryWrapper<Map<String, Object>> wrapper);

    Shop shopById(Integer shopId);
}
